package com.hospital.search.module.base;

/**
 * 排序类型枚举
 * 0: 热度排序
 * 1: 创建时间排序
 * 2: 更新时间排序
 * @author yhn
 * @version 1.0
 */
public enum SortType {
    HEAT_SCORE(0, "heatScore"),
    CREATE_TIME(1, "createTime"),
    UPDATE_TIME(2, "updateTime");
    public final Integer value;
    public final String filed;
    SortType(Integer value, String filed) {
        this.value = value;
        this.filed = filed;
    }
    public static SortType getByValue(Integer value) {
        for (SortType sortType : SortType.values()) {
            if (sortType.value.equals(value)) {
                return sortType;
            }
        }
        return null;
    }
}
